package com.example.designpatterns.creational.prototype;

import lombok.Data;

/**
 * 具体原型类
 *
 * @author scott
 */
@Data
public class ConcretePrototype implements CloneablePrototype {

    private int id;

    public ConcretePrototype(int id) {
        this.id = id;
    }

    @Override
    public ConcretePrototype clone() {
        try {
            return (ConcretePrototype) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
            return null;
        }
    }

}
